import icon_analysis_analyze_def from '../../image/icons/svg/icon_analysis_analyze_def.svg';
import icon_en_later_environment_def from '../../image/icons/svg/icon_en_later_environment_def.svg';
import icon_engineering_project_def from '../../image/icons/svg/icon_engineering_project_def.svg';
import icon_interactive_roaming_def from '../../image/icons/svg/icon_interactive_roaming_def.svg';
import icon_tools_def from '../../image/icons/svg/icon_tools_def.svg';
import icon_resource_library_def from '../../image/icons/svg/icon_resource_library_def.svg';
import icon_guide_play_def from '../../image/icons/svg/icon_guide_play_def.svg';
import icon_guide_def from '../../image/icons/svg/icon_guide_def.svg';

export let listF = [
    {
        icon: icon_engineering_project_def,
        label: '工程',
        children: [
            {
                id: 'icon_engineering_home_def',
                icon: 'icon_engineering_home_def',
                label: '主页',
                component: 'Function',
                type: 'UIPanelType.MainUI'
            },
            {
                id: 'icon_engineering_new_def',
                icon: 'icon_engineering_new_def',
                label: '新建',
                component: 'Function',
                type: 'UIPanelType.NewACP'
            },
            {
                id: 'icon_engineering_open_def',
                icon: 'icon_engineering_open_def',
                label: '打开',
                component: 'Function',
                type: 'UIPanelType.OpenACP'
            },
            {
                id: 'icon_engineering_save_def',
                icon: 'icon_engineering_save_def',
                label: '保存',
                component: 'Function',
                type: 'UIPanelType.SaveACP'
            },
            {
                id: 'icon_engineering_mergeprj_def',
                icon: 'icon_engineering_mergeprj_def',
                label: '合并',
                component: 'Function',
                type: 'UIPanelType.MergeACP'
            },
            {
                id: 'icon_engineering_add_def',
                icon: 'icon_engineering_add_def',
                label: '导入3DT',
                component: 'Function',
                type: 'UIPanelType.Load3DT'
            },
            {
                id: 'icon_engineering_shapefile_def',
                icon: 'icon_engineering_shapefile_def',
                label: '导入SHP',
                component: 'Function',
                type: 'UIPanelType.LoadSHP'
            },
            {
                id: 'icon_engineering_add3dtiles_def',
                icon: 'icon_engineering_add3dtiles_def',
                label: '导入3DTiles',
                component: 'Function',
                type: 'UIPanelType.Load3DTiles'
            },
            // {
            //     id: 'icon_engineering_adds3m_def',
            //     icon: 'icon_engineering_adds3m_def',
            //     label: '导入S3M',
            //     component: 'Function',
            //     type: 'UIPanelType.NewACP' // TODO: 暂时去掉
            // },
            {
                id: 'icon_engineering_exit_def',
                icon: 'icon_engineering_exit_def',
                label: '退出',
                component: 'Function',
                type: 'UIPanelType.Exit'
            }
        ]
    },
    {
        icon: icon_interactive_roaming_def,
        label: '交互',
        children: [
            {
                id: 'icon_interactive_roaming_def',
                icon: 'icon_interactive_roaming_def',
                label: '漫游',
                component: 'Function',
                type: 'UIPanelType.Around'
            },
            {
                id: 'icon_interactive_CenterRoam_def',
                icon: 'icon_interactive_CenterRoam_def',
                label: '中心 漫游',
                component: 'Function',
                type: 'UIPanelType.CenterAround'
            },
            {
                id: 'icon_interactive_Thirdperson_def',
                icon: 'icon_interactive_Thirdperson_def',
                label: '角色',
                component: 'Function',
                type: 'UIPanelType.Role'
            },
            {
                id: 'icon_interactive_Drone_def',
                icon: 'icon_interactive_Drone_def',
                label: '无人机',
                component: 'Function',
                type: 'UIPanelType.Robomb'
            },
            {
                id: 'icon_interactive_mapmode_def',
                icon: 'icon_interactive_mapmode_def',
                label: '地图',
                component: 'Function',
                type: 'UIPanelType.Map'
            },
            {
                id: 'icon_interactive_drivingmode_def',
                icon: 'icon_interactive_drivingmode_def',
                label: '驾驶',
                component: 'Function',
                type: 'UIPanelType.Vehicle'
            },
            {
                id: 'icon_interactive_editmode_def',
                icon: 'icon_interactive_editmode_def',
                label: '编辑 模式',
                component: 'Function',
                type: 'UIPanelType.Edit'
            }
        ]
    },
    {
        icon: icon_en_later_environment_def,
        label: '环境',
        children: [
            {
                id: 'icon_en_later_environment_def',
                icon: 'icon_en_later_environment_def',
                label: '天气',
                component: 'Function',
                type: 'UIPanelType.Weather'
            },
            {
                id: 'icon_en_later_effect_def',
                icon: 'icon_en_later_effect_def',
                label: '后期',
                component: 'Function',
                type: 'UIPanelType.PostProcess'
            },
            {
                id: 'icon_en_later_camera_def',
                icon: 'icon_en_later_camera_def',
                label: '相机',
                component: 'Function',
                type: 'UIPanelType.Camera'
            },
            {
                id: 'icon_en_later_display_def',
                icon: 'icon_en_later_display_def',
                label: '显示',
                component: 'Function',
                type: 'UIPanelType.ShowSettings'
            }
        ]
    },
    {
        icon: icon_tools_def,
        label: '工具',
        children: [
            {
                id: 'icon_tool_coordinate_def',
                icon: 'icon_tool_coordinate_def',
                label: '坐标',
                component: 'Function',
                type: 'UIPanelType.Measure'
            },
            {
                id: 'icons_tool_linemea_def',
                icon: 'icons_tool_linemea_def',
                label: '直线',
                component: 'Function',
                type: 'UIPanelType.Measure'
            },
            {
                id: 'icon_tool_horizontalmea_def',
                icon: 'icon_tool_horizontalmea_def',
                label: '水平',
                component: 'Function',
                type: 'UIPanelType.Measure'
            },
            {
                id: 'icon_tool_verticamea_def',
                icon: 'icon_tool_verticamea_def',
                label: '垂直',
                component: 'Function',
                type: 'UIPanelType.Measure'
            },
            {
                id: 'icon_tool_measAread_def',
                icon: 'icon_tool_measAread_def',
                label: '投影 面积',
                component: 'Function',
                type: 'UIPanelType.Measure'
            },
            {
                id: 'icon_tool_surface_area_def',
                icon: 'icon_tool_surface_area_def',
                label: '地表 面积',
                component: 'Function',
                type: 'UIPanelType.Measure'
            },
            {
                id: 'icon_tool_toflatten_def',
                icon: 'icon_tool_toflatten_def',
                label: '压平',
                component: 'Function',
                type: 'UIPanelType.Flatten'
            },
            {
                id: 'icon_tool_cutpolygon_def',
                icon: 'icon_tool_cutpolygon_def',
                label: '挖洞',
                component: 'Function',
                type: 'UIPanelType.Hole'
            },
            {
                id: 'icon_tool_cut_def',
                icon: 'icon_tool_cut_def',
                label: '面剖切',
                component: 'Function',
                type: 'UIPanelType.Clip'
            },
            {
                id: 'icon_tool_cutbox_def',
                icon: 'icon_tool_cutbox_def',
                label: '体剖切',
                component: 'Function',
                type: 'UIPanelType.Clip'
            },
            {
                id: 'icon_tool_PolygonClip_def',
                icon: 'icon_tool_PolygonClip_def',
                label: '多边形剖切',
                component: 'Function',
                type: 'UIPanelType.Clip'
            },
            {
                id: 'icon_tool_Inquire_def',
                icon: 'icon_tool_Inquire_def',
                label: '点选 查询',
                component: 'Function',
                type: 'UIPanelType.Select'
            },
            {
                id: 'icon_tool_guide_Addguide_def',
                icon: 'icon_tool_guide_Addguide_def',
                label: '截屏',
                component: 'Function',
                type: 'UIPanelType.Screenshot'
            }
        ]
    },
    {
        icon: icon_analysis_analyze_def,
        label: '分析',
        children: [
            {
                id: 'icon_analysis_contourline_def',
                icon: 'icon_analysis_contourline_def',
                label: '等高线',
                component: 'Function',
                type: 'UIPanelType.ContourLineAnalysis'
            },
            {
                id: 'icon_analysis_CutFillAna_def',
                icon: 'icon_analysis_CutFillAna_def',
                label: '填挖方',
                component: 'Function',
                type: 'UIPanelType.CutFillAnalysis'
            },
            {
                id: 'icon_analysis_FloodFill_def',
                icon: 'icon_analysis_FloodFill_def',
                label: '水淹',
                component: 'Function',
                type: 'UIPanelType.FloodFillAnalysis'
            },
            {
                id: 'icon_analysis_Openness_def',
                icon: 'icon_analysis_Openness_def',
                label: '开敞度',
                component: 'Function',
                type: 'UIPanelType.ViewDomeAnalysis'
            },
            {
                id: 'icon_analysis_skyline_def',
                icon: 'icon_analysis_skyline_def',
                label: '天际线',
                component: 'Function',
                type: 'UIPanelType.SkylineAnalysis'
            },
            {
                id: 'icon_analysis_slope_def',
                icon: 'icon_analysis_slope_def',
                label: '坡度坡向',
                component: 'Function',
                type: 'UIPanelType.TerrainSlopeAnalysi'
            },
            {
                id: 'icon_analysis_sunshine_def',
                icon: 'icon_analysis_sunshine_def',
                label: '日照',
                component: 'Function',
                type: 'UIPanelType.SolarAnalysis'
            },
            {
                id: 'icon_analysis_VisibilityAnalysis_def',
                icon: 'icon_analysis_VisibilityAnalysis_def',
                label: '通视',
                component: 'Function',
                type: 'UIPanelType.VisiblityAnalysis'
            },
            {
                id: 'icon_analysis_visual_def',
                icon: 'icon_analysis_visual_def',
                label: '可视域',
                component: 'Function',
                type: 'UIPanelType.ViewshedAnalysis'
            }
        ]
    },
    {
        icon: icon_resource_library_def,
        label: '资源',
        children: [
            {
                id: 'icon_resource_Material_def',
                icon: 'icon_resource_Material_def',
                label: '材质 编辑',
                component: 'Function',
                type: 'UIPanelType.Material'
            },
            {
                id: 'icon_resource_tree_def',
                icon: 'icon_resource_tree_def',
                label: '植被',
                component: 'Function',
                type: 'UIPanelType.Vegetation'
            },
            {
                id: 'icon_resource_car_def',
                icon: 'icon_resource_car_def',
                label: '交通工具',
                component: 'Function',
                type: 'UIPanelType.Vehicle'
            },
            {
                id: 'icon_resource_Water_def',
                icon: 'icon_resource_Water_def',
                label: '水',
                component: 'Function',
                type: 'UIPanelType.DynamicWater'
            },
            {
                id: 'icon_resource_videoprojection_def',
                icon: 'icon_resource_videoprojection_def ',
                label: '视频投影',
                component: 'Function',
                type: 'UIPanelType.VideoProjection'
            },
            {
                id: 'icon_resource_panorama_def',
                icon: 'icon_resource_panorama_def',
                label: '全景图',
                component: 'Function',
                type: 'UIPanelType.Panorama'
            },
            {
                id: 'icon_resource_light_def',
                icon: 'icon_resource_light_def',
                label: '灯光',
                component: 'Function',
                type: 'UIPanelType.Light'
            },
            {
                id: 'icon_resource_label_def',
                icon: 'icon_resource_label_def',
                label: '标签',
                component: 'Function',
                type: 'UIPanelType.Marker'
            },
            {
                id: 'icon_resource_Dynamicmarkup_def',
                icon: 'icon_resource_Dynamicmarkup_def',
                label: '动态标记',
                component: 'Function',
                type: 'UIPanelType.Marker3D'
            },
            {
                id: 'icon_resource_applique_def',
                icon: 'icon_resource_applique_def',
                label: '贴画',
                component: 'Function',
                type: 'UIPanelType.Decal'
            },
            {
                id: 'icon_resource_OD_def',
                icon: 'icon_resource_OD_def',
                label: '光流',
                component: 'Function',
                type: 'UIPanelType.Beam'
            },
            {
                id: 'icon_resource_polygon_def',
                icon: 'icon_resource_polygon_def',
                label: '多边形',
                component: 'Function',
                type: 'UIPanelType.Polygon'
            },
            {
                id: 'icon_resource_polyline_def',
                icon: 'icon_resource_polyline_def',
                label: '折线',
                component: 'Function',
                type: 'UIPanelType.Polyline'
            },
            {
                id: 'icon_resource_point_def',
                icon: 'icon_resource_point_def',
                label: '辐射圈',
                component: 'Function',
                type: 'UIPanelType.RadiationPoint'
            }
        ]
    },
    {
        id: 'icon_guide_def_Function',
        icon: icon_guide_def,
        label: '导览',
        type: 'UIPanelType.CameraTour',
        component: "Function",
        cIcon: 'icon_guide_def'
    },
    {
        id: 'icon_guide_play_def_Function',
        icon: icon_guide_play_def,
        label: '汇报模式',
        type: 'UIPanelType.Report',
        component: "Function",
        cIcon: 'icon_guide_play_def'
    }
];

export function setListF() {
    let newList = [];
    for (let index = 0; index < listF.length; index++) {
        const element = listF[index];
        const label = element.label;
        if (element.children && element.children.length) {
            for (let j = 0; j < element.children.length; j++) {
                const item = element.children[j];
                let commonModule = {
                    component: 'Function',
                    id: item.id,
                    style: {
                        width: {
                            value: 50,
                            pixel: 50,
                            unit: 'px'
                        },
                        height: {
                            value: 50,
                            pixel: 50,
                            unit: 'px'
                        },
                        top: {
                            value: 0,
                            pixel: 0,
                            unit: 'px'
                        },
                        left: {
                            value: 0,
                            pixel: 0,
                            unit: 'px'
                        },
                        bottom: {
                            value: '',
                            unit: 'px'
                        },
                        right: {
                            value: '',
                            unit: 'px'
                        },
                        color: '#FFFFFFE6',
                        rotate: 0,
                        borderRadius: '',
                        backgroundImage: {
                            angle: 90,
                            color: []
                        },
                        borderRadius: {
                            value: 0,
                            unit: 'px'
                        },
                        borderWidth: 0,
                        borderStyle: 'solid',
                        borderColor: '#FFFFFF',
                        boxShadow: {
                            level: 0,
                            vertical: 0,
                            blur: 0,
                            spread: 0,
                            color: '#000000FF'
                        },
                        opacity: 100,
                        'z-index': '1'
                    },
                    attribute: {
                        visible: true,
                        page: 0,
                        highlight: false,
                        locked: false
                    },
                    animate: [],
                    event: [],
                    data: {
                        url: item.icon,
                        type: item.type,
                        label: label
                    }
                }
                newList.push(commonModule);
            }
        } else {
            let commonModule = {
                component: 'Function',
                id: element.id,
                style: {
                    width: {
                        value: 50,
                        pixel: 50,
                        unit: 'px'
                    },
                    height: {
                        value: 50,
                        pixel: 50,
                        unit: 'px'
                    },
                    top: {
                        value: 0,
                        pixel: 0,
                        unit: 'px'
                    },
                    left: {
                        value: 0,
                        pixel: 0,
                        unit: 'px'
                    },
                    bottom: {
                        value: '',
                        unit: 'px'
                    },
                    right: {
                        value: '',
                        unit: 'px'
                    },
                    color: '#FFFFFFE6',
                    rotate: 0,
                    borderRadius: '',
                    backgroundImage: {
                        angle: 90,
                        color: []
                    },
                    borderRadius: {
                        value: 0,
                        unit: 'px'
                    },
                    borderWidth: 0,
                    borderStyle: 'solid',
                    borderColor: '#FFFFFF',
                    boxShadow: {
                        level: 0,
                        vertical: 0,
                        blur: 0,
                        spread: 0,
                        color: '#000000FF'
                    },
                    opacity: 100,
                    'z-index': '1'
                },
                attribute: {
                    visible: true,
                    page: 0,
                    highlight: false,
                    locked: false
                },
                animate: [],
                event: [],
                data: {
                    url: element.cIcon,
                    type: element.type,
                    label: label
                }
            }
            newList.push(commonModule);
        }
    }
    return newList;
};